/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * monedero_sie_catalogo.java
 *
 * Created on 16/03/2011, 12:59:29 PM
 */

package sie_invdis;

import java.sql.*;
import javax.swing.*;
import java.awt.*;

import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.text.*;
/**
 *
 * @author Michelle
 */
public class monedero_sie_catalogo extends javax.swing.JFrame {
private JTable jtable_tiendas;
private javax.swing.table.DefaultTableModel jtable_modelo;
private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
   bd_conexion x = new bd_conexion() ;
       //se creaa la variable resultset
   ResultSet rs = null;
    private java.util.Date fechahoy=new Date();

    private int buscamp=0,controlcombo=0;
    private String tiendafiltro="all";
    /** Creates new form monedero_sie_catalogo */
    public monedero_sie_catalogo() {
        this.iniciar_modelo_de_tabla();
        initComponents();
        this.setLocation(25,25);
       // x.estableceConexion();
        this.loadcombo();
        if(JOptionPane.showConfirmDialog(null, "Desea Cargar Catalogo?")==0)
            {
                this.carga_datos(0,"");
                this.cargarsaldomon();
            }
        jtb_catalogomonedero.getColumnModel().getColumn(0).setPreferredWidth(30);//ranquin
        jtb_catalogomonedero.getColumnModel().getColumn(1).setPreferredWidth(40);//tarjeta
        jtb_catalogomonedero.getColumnModel().getColumn(2).setPreferredWidth(90);//nombre
        jtb_catalogomonedero.getColumnModel().getColumn(3).setPreferredWidth(80);//correo
        jtb_catalogomonedero.getColumnModel().getColumn(4).setPreferredWidth(60);//tienda
        jtb_catalogomonedero.getColumnModel().getColumn(5).setPreferredWidth(40);//Movimientos
        jtb_catalogomonedero.getColumnModel().getColumn(6).setPreferredWidth(40);//Saldo
        jtb_catalogomonedero.getColumnModel().getColumn(7).setPreferredWidth(90);//Ultima Combra
        jtb_catalogomonedero.getTableHeader().setBackground(Color.yellow);

        this.buttonGroup1.setSelected(jrbtn_nombreclie.getModel(), true);
        buscamp=4;
        this.jtf_busqueda.requestFocus();
         if ((variables_global.getnivelusu() > 2) && (variables_global.getnivelusu() < 6))
             {
                this.jbtn_saldogralpuntos.setVisible(false);
                this.jbtn_monederos_entrega.setVisible(false);
             }
    }


    private void loadcombo(){
        jtable_tiendas=variables_global.gettabla_tiendas();
         int numerotiendas=this.jtable_tiendas.getRowCount();
         this.jcbx_tiendas.addItem("Selecciones Una Tienda");
          for(int ii=0;ii<numerotiendas;ii++)
                        {
                            this.jcbx_tiendas.addItem(jtable_tiendas.getValueAt(ii, 0));
                        }
    }
     private void iniciar_modelo_de_tabla()
    {

        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><b>Ranking</b></html>");
        jtable_modelo.addColumn("<html><b>Tarjeta</b></html>");
        jtable_modelo.addColumn("<html><b>Nombre</b></html>");
        jtable_modelo.addColumn("<html><b>Correo</b></html>");
        jtable_modelo.addColumn("<html><b>F.Nacimiento</b></html>");
        jtable_modelo.addColumn("<html><b>Tienda</b></html>");
        jtable_modelo.addColumn("<html><b>Movimientos</b></html>");
        jtable_modelo.addColumn("<html><b>Saldo</b></html>");
        jtable_modelo.addColumn("<html><b>Ultima Compra</b></html>");
   }
       private void carga_datos(int opbus,String tbusca)
    {
        int rankin=0;
        String fechacat = "";
        DecimalFormat miformat = new DecimalFormat("############.##");
        java.util.Date fechainicial=new Date();

        while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
        String texto="select * from x1monedero_catalogo('"+tiendafiltro+"',"+opbus+",'"+tbusca+"') as (idcli integer,emai text,tie integer,direcc text,idtarmon integer,codi text,clinombre text,clifechanac text,nmov bigint,sald double precision,tienombre text,fech date,cli_apat text,fecha_mes text);";
        System.out.println(texto);
        try
         {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    rankin+=1;
                    try{
                        fechainicial = formateadoresta.parse(rs.getString(12));
                       }
                    catch (ParseException e)
                    {
                        //Error, la cadena de texto no se puede convertir en fecha.
                    }
                //jtable_modelo.addRow(new Object[]{rankin,rs.getString ("codi"),rs.getString ("idcli")+":"+rs.getString ("clinombre"),rs.getString ("emai"),rs.getString ("clifechanac").replace("/", "-"),rs.getString ("tienombre"),rs.getString ("nmov"),miformat.format(rs.getFloat("sald")),this.fechaeuropea(rs.getString ("fech"))+" "+this.mensajetiempo(this.fechasDiferenciaEnDias(fechainicial, fechahoy))});
                jtable_modelo.addRow(new Object[]{rankin,rs.getString ("codi"),rs.getString ("idcli")+":"+rs.getString ("clinombre"),rs.getString ("emai"),rs.getString ("clifechanac").replace("/", "-"),rs.getString ("tienombre"),rs.getString ("nmov"),miformat.format(rs.getFloat("sald")),this.fechaeuropea(rs.getString ("fech"))+" "+this.mensajetiempo(this.fechasDiferenciaEnDias(fechainicial, fechahoy))});
                }

        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }

        this.registrosobtenidos();
      }



private String  fechaeuropea(String fecha) {

         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;

    }
 

 void registrosobtenidos()
 {
     //limpiar la tabla
    this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo.getRowCount()));
    this.jlbl_textobuscado.setText(this.jtf_busqueda.getText().toUpperCase().trim());
 }
private void cargarsaldomon(){
     //voy por saldo de puntos
        //voy por saldo de puntos
        //voy por saldo de puntos
     String dia="";
     DecimalFormat miformat = new DecimalFormat("###,###,###,###");
     float totgen=0;

        try{
           dia="select * from x1monederosaldogeneral() as (saldo double precision);";
           rs = x.sieuno_executediversosv2(dia,variables_global.getconexiongral());
           while (rs.next())
                  {
                      totgen=rs.getFloat(1);
                  }//consulto la bd
            }
            catch(Exception e)
            {
                    System.out.println(e.getMessage());
            }
            this.jbtn_saldogralpuntos.setText("Sdo. Gral de Puntos:"+miformat.format(totgen));
            //voy por tarjetas entregadas
            //voy por tarjetas entregadas
            //voy por tarjetas entregadas

            //voy por saldo de puntos
        //voy por saldo de puntos
        //voy por saldo de puntos
        try{
           dia="select * from x1monederonclientes() as (cantidad bigint);";
           rs = x.sieuno_executediversosv2(dia,variables_global.getconexiongral());
           while (rs.next())
                  {
                      totgen=rs.getFloat(1);
                  }//consulto la bd
            }
            catch(Exception e)
            {
                    System.out.println(e.getMessage());
            }
            this.jbtn_monederos_entrega.setText("Monederos Entregados:"+miformat.format(totgen));




}
private String DiaSemana(String fe) {
         String dia = "";
       java.util.Date fecha=null;
         try
            {
             fecha = formateador.parse(fe);

           }
        catch (ParseException e)
            {
            //Error, la cadena de texto no se puede convertir en fecha.
            }
        Calendar cal= Calendar.getInstance();
        cal.setTime(fecha);
        //ojo para establecer o recetear cada parte de la fecha por separado
        //cal.set(Calendar.YEAR, fecha.getYear());
        //cal.set(Calendar.MONTH, fecha.getMonth());
        //cal.set(Calendar.DAY_OF_MONTH, fecha.getDay());
        int diaInt = cal.get(Calendar.DAY_OF_WEEK);
        switch (diaInt) {
            case 1:
                dia = "Domingo";
                break;
            case 2:
                dia = "Lunes";
                break;
            case 3:
                dia = "Martes";
                break;
            case 4:
                dia = "Miercoles";
                break;
            case 5:
                dia = "Jueves";
                break;
            case 6:
                dia = "Viernes";
                break;
            case 7:
                dia = "Sabado";
                break;

        }
        return dia;
    }

private int fechasDiferenciaEnDias(Date fechaInicial, Date fechaFinal) {

        DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
        String fechaInicioString = df.format(fechaInicial);
            try {
                fechaInicial = df.parse(fechaInicioString);
                }
                catch (ParseException ex) {
                }

        String fechaFinalString = df.format(fechaFinal);
                try {
                    fechaFinal = df.parse(fechaFinalString);
                    }
                catch (ParseException ex) {
                    }

            long fechaInicialMs = fechaInicial.getTime();
            long fechaFinalMs = fechaFinal.getTime();
            long diferencia = fechaFinalMs - fechaInicialMs;
            double dias = Math.floor(diferencia / (1000 * 60 * 60 * 24));
            return ( (int) dias);
    }

 private String mensajetiempo(int nd) {
     String mensaje="";
     if (nd==0)
				{
					mensaje=" Hoy ";
				}
		if (nd==1)
				{
					mensaje=" ayer ";
				}
		if (nd>1)
				{
					mensaje=" Hace " + nd + " Dias " ;
				}
 	return mensaje;
 }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jbtn_salir = new javax.swing.JButton();
        jbtn_saldogralpuntos = new javax.swing.JButton();
        jbtn_monederos_entrega = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jbtn_ayuda = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jbtn_busqueda = new javax.swing.JButton();
        jtf_busqueda = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jrbtn_monedero = new javax.swing.JRadioButton();
        jrbtn_tienda = new javax.swing.JRadioButton();
        jrbtn_email = new javax.swing.JRadioButton();
        jrbtn_nombreclie = new javax.swing.JRadioButton();
        jrbtn_apaterno = new javax.swing.JRadioButton();
        jrbtn_fecha = new javax.swing.JRadioButton();
        jrbtn_nomovimientos = new javax.swing.JRadioButton();
        jrbtn_ultcompra = new javax.swing.JRadioButton();
        jcbx_tiendas = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jrbtn_100 = new javax.swing.JRadioButton();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtb_catalogomonedero = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jLabel3 = new javax.swing.JLabel();
        jlbl_cantidadregistros = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jlbl_textobuscado = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jmni_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jmni_buscar = new javax.swing.JMenuItem();
        jmni_busqueda = new javax.swing.JMenuItem();
        jmni_saldonegativo = new javax.swing.JMenuItem();
        jmni_escape = new javax.swing.JMenuItem();
        jmni_actualizar = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jmni_ayuda = new javax.swing.JMenuItem();
        jmni_creacomentario = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(monedero_sie_catalogo.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel1.setName("jPanel1"); // NOI18N

        jbtn_salir.setIcon(resourceMap.getIcon("jbtn_salir.icon")); // NOI18N
        jbtn_salir.setText(resourceMap.getString("jbtn_salir.text")); // NOI18N
        jbtn_salir.setName("jbtn_salir"); // NOI18N
        jbtn_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_salirActionPerformed(evt);
            }
        });

        jbtn_saldogralpuntos.setIcon(resourceMap.getIcon("jbtn_saldogralpuntos.icon")); // NOI18N
        jbtn_saldogralpuntos.setText(resourceMap.getString("jbtn_saldogralpuntos.text")); // NOI18N
        jbtn_saldogralpuntos.setName("jbtn_saldogralpuntos"); // NOI18N
        jbtn_saldogralpuntos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_saldogralpuntosActionPerformed(evt);
            }
        });

        jbtn_monederos_entrega.setIcon(resourceMap.getIcon("jbtn_monederos_entrega.icon")); // NOI18N
        jbtn_monederos_entrega.setText(resourceMap.getString("jbtn_monederos_entrega.text")); // NOI18N
        jbtn_monederos_entrega.setName("jbtn_monederos_entrega"); // NOI18N
        jbtn_monederos_entrega.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_monederos_entregaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jbtn_saldogralpuntos, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(31, 31, 31)
                .addComponent(jbtn_monederos_entrega, javax.swing.GroupLayout.PREFERRED_SIZE, 254, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 299, Short.MAX_VALUE)
                .addComponent(jbtn_salir))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jbtn_salir)
                    .addComponent(jbtn_monederos_entrega, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtn_saldogralpuntos, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.setName("jPanel2"); // NOI18N

        jbtn_ayuda.setIcon(resourceMap.getIcon("jbtn_ayuda.icon")); // NOI18N
        jbtn_ayuda.setText(resourceMap.getString("jbtn_ayuda.text")); // NOI18N
        jbtn_ayuda.setName("jbtn_ayuda"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(825, Short.MAX_VALUE)
                .addComponent(jbtn_ayuda)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jbtn_ayuda)
                .addContainerGap(13, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel3.setName("jPanel3"); // NOI18N

        jbtn_busqueda.setIcon(resourceMap.getIcon("jbtn_busqueda.icon")); // NOI18N
        jbtn_busqueda.setText(resourceMap.getString("jbtn_busqueda.text")); // NOI18N
        jbtn_busqueda.setName("jbtn_busqueda"); // NOI18N
        jbtn_busqueda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_busquedaActionPerformed(evt);
            }
        });

        jtf_busqueda.setText(resourceMap.getString("jtf_busqueda.text")); // NOI18N
        jtf_busqueda.setToolTipText(resourceMap.getString("jtf_busqueda.toolTipText")); // NOI18N
        jtf_busqueda.setName("jtf_busqueda"); // NOI18N
        jtf_busqueda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_busquedaActionPerformed(evt);
            }
        });

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        buttonGroup1.add(jrbtn_monedero);
        jrbtn_monedero.setText(resourceMap.getString("jrbtn_monedero.text")); // NOI18N
        jrbtn_monedero.setToolTipText(resourceMap.getString("jrbtn_monedero.toolTipText")); // NOI18N
        jrbtn_monedero.setActionCommand(resourceMap.getString("jrbtn_monedero.actionCommand")); // NOI18N
        jrbtn_monedero.setName("jrbtn_monedero"); // NOI18N
        jrbtn_monedero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbtn_monederoActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrbtn_tienda);
        jrbtn_tienda.setText(resourceMap.getString("jrbtn_tienda.text")); // NOI18N
        jrbtn_tienda.setToolTipText(resourceMap.getString("jrbtn_tienda.toolTipText")); // NOI18N
        jrbtn_tienda.setActionCommand(resourceMap.getString("jrbtn_tienda.actionCommand")); // NOI18N
        jrbtn_tienda.setName("jrbtn_tienda"); // NOI18N
        jrbtn_tienda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbtn_tiendaActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrbtn_email);
        jrbtn_email.setText(resourceMap.getString("jrbtn_email.text")); // NOI18N
        jrbtn_email.setToolTipText(resourceMap.getString("jrbtn_email.toolTipText")); // NOI18N
        jrbtn_email.setActionCommand(resourceMap.getString("jrbtn_email.actionCommand")); // NOI18N
        jrbtn_email.setName("jrbtn_email"); // NOI18N
        jrbtn_email.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbtn_emailActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrbtn_nombreclie);
        jrbtn_nombreclie.setText(resourceMap.getString("jrbtn_nombreclie.text")); // NOI18N
        jrbtn_nombreclie.setToolTipText(resourceMap.getString("jrbtn_nombreclie.toolTipText")); // NOI18N
        jrbtn_nombreclie.setActionCommand(resourceMap.getString("jrbtn_nombreclie.actionCommand")); // NOI18N
        jrbtn_nombreclie.setName("jrbtn_nombreclie"); // NOI18N
        jrbtn_nombreclie.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbtn_nombreclieActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrbtn_apaterno);
        jrbtn_apaterno.setText(resourceMap.getString("jrbtn_apaterno.text")); // NOI18N
        jrbtn_apaterno.setToolTipText(resourceMap.getString("jrbtn_apaterno.toolTipText")); // NOI18N
        jrbtn_apaterno.setActionCommand(resourceMap.getString("jrbtn_apaterno.actionCommand")); // NOI18N
        jrbtn_apaterno.setName("jrbtn_apaterno"); // NOI18N
        jrbtn_apaterno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbtn_apaternoActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrbtn_fecha);
        jrbtn_fecha.setText(resourceMap.getString("jrbtn_fecha.text")); // NOI18N
        jrbtn_fecha.setActionCommand(resourceMap.getString("jrbtn_fecha.actionCommand")); // NOI18N
        jrbtn_fecha.setName("jrbtn_fecha"); // NOI18N
        jrbtn_fecha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbtn_fechaActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrbtn_nomovimientos);
        jrbtn_nomovimientos.setText(resourceMap.getString("jrbtn_nomovimientos.text")); // NOI18N
        jrbtn_nomovimientos.setActionCommand(resourceMap.getString("jrbtn_nomovimientos.actionCommand")); // NOI18N
        jrbtn_nomovimientos.setName("jrbtn_nomovimientos"); // NOI18N
        jrbtn_nomovimientos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbtn_nomovimientosActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrbtn_ultcompra);
        jrbtn_ultcompra.setText(resourceMap.getString("jrbtn_ultcompra.text")); // NOI18N
        jrbtn_ultcompra.setActionCommand(resourceMap.getString("jrbtn_ultcompra.actionCommand")); // NOI18N
        jrbtn_ultcompra.setName("jrbtn_ultcompra"); // NOI18N
        jrbtn_ultcompra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbtn_ultcompraActionPerformed(evt);
            }
        });

        jcbx_tiendas.setName("jcbx_tiendas"); // NOI18N
        jcbx_tiendas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbx_tiendasActionPerformed(evt);
            }
        });

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        buttonGroup1.add(jrbtn_100);
        jrbtn_100.setText(resourceMap.getString("jrbtn_100.text")); // NOI18N
        jrbtn_100.setToolTipText(resourceMap.getString("jrbtn_100.toolTipText")); // NOI18N
        jrbtn_100.setActionCommand(resourceMap.getString("jrbtn_100.actionCommand")); // NOI18N
        jrbtn_100.setName("jrbtn_100"); // NOI18N
        jrbtn_100.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrbtn_100ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(139, 139, 139)
                        .addComponent(jLabel1)
                        .addGap(18, 18, 18)
                        .addComponent(jcbx_tiendas, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel2)
                        .addGap(18, 18, 18)
                        .addComponent(jtf_busqueda, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jbtn_busqueda))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(41, 41, 41)
                        .addComponent(jrbtn_100)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrbtn_monedero)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jrbtn_tienda)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jrbtn_email)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrbtn_nombreclie)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrbtn_fecha)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrbtn_nomovimientos)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrbtn_apaterno)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrbtn_ultcompra)))
                .addContainerGap(160, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbtn_busqueda)
                    .addComponent(jtf_busqueda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(jcbx_tiendas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jrbtn_monedero)
                    .addComponent(jrbtn_tienda)
                    .addComponent(jrbtn_email)
                    .addComponent(jrbtn_nombreclie)
                    .addComponent(jrbtn_100)
                    .addComponent(jrbtn_fecha)
                    .addComponent(jrbtn_nomovimientos)
                    .addComponent(jrbtn_apaterno)
                    .addComponent(jrbtn_ultcompra)))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel4.border.title"))); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jtb_catalogomonedero.setModel(this.jtable_modelo);
        jtb_catalogomonedero.setName("jtb_catalogomonedero"); // NOI18N
        jtb_catalogomonedero.setRowHeight(22);
        jtb_catalogomonedero.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtb_catalogomonederoMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    dioclick(evt);
                    //System.out.println(" double click" );

                }

            }
        });
        jScrollPane1.setViewportView(jtb_catalogomonedero);

        jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jlbl_cantidadregistros.setFont(resourceMap.getFont("jlbl_cantidadregistros.font")); // NOI18N
        jlbl_cantidadregistros.setText(resourceMap.getString("jlbl_cantidadregistros.text")); // NOI18N
        jlbl_cantidadregistros.setName("jlbl_cantidadregistros"); // NOI18N

        jLabel5.setFont(resourceMap.getFont("jLabel5.font")); // NOI18N
        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jlbl_textobuscado.setFont(resourceMap.getFont("jlbl_textobuscado.font")); // NOI18N
        jlbl_textobuscado.setText(resourceMap.getString("jlbl_textobuscado.text")); // NOI18N
        jlbl_textobuscado.setName("jlbl_textobuscado"); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 908, Short.MAX_VALUE)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jlbl_textobuscado, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3)
                .addGap(18, 18, 18)
                .addComponent(jlbl_cantidadregistros, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel5)
                .addContainerGap(555, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jlbl_cantidadregistros)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4)
                    .addComponent(jlbl_textobuscado))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 390, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
        jmni_salir.setName("jmni_salir"); // NOI18N
        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_salirActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jmni_buscar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.ALT_MASK));
        jmni_buscar.setIcon(resourceMap.getIcon("jmni_buscar.icon")); // NOI18N
        jmni_buscar.setText(resourceMap.getString("jmni_buscar.text")); // NOI18N
        jmni_buscar.setName("jmni_buscar"); // NOI18N
        jMenu2.add(jmni_buscar);

        jmni_busqueda.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.ALT_MASK));
        jmni_busqueda.setText(resourceMap.getString("jmni_busqueda.text")); // NOI18N
        jmni_busqueda.setName("jmni_busqueda"); // NOI18N
        jMenu2.add(jmni_busqueda);

        jmni_saldonegativo.setText(resourceMap.getString("jmni_saldonegativo.text")); // NOI18N
        jmni_saldonegativo.setName("jmni_saldonegativo"); // NOI18N
        jmni_saldonegativo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_saldonegativoActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_saldonegativo);

        jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
        jmni_escape.setName("jmni_escape"); // NOI18N
        jmni_escape.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_escapeActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_escape);

        jmni_actualizar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, 0));
        jmni_actualizar.setText(resourceMap.getString("jmni_actualizar.text")); // NOI18N
        jmni_actualizar.setName("jmni_actualizar"); // NOI18N
        jmni_actualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_actualizarActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_actualizar);

        jMenuBar1.add(jMenu2);

        jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
        jMenu3.setName("jMenu3"); // NOI18N

        jmni_ayuda.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK));
        jmni_ayuda.setIcon(resourceMap.getIcon("jmni_ayuda.icon")); // NOI18N
        jmni_ayuda.setText(resourceMap.getString("jmni_ayuda.text")); // NOI18N
        jmni_ayuda.setName("jmni_ayuda"); // NOI18N
        jMenu3.add(jmni_ayuda);

        jmni_creacomentario.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.ALT_MASK));
        jmni_creacomentario.setText(resourceMap.getString("jmni_creacomentario.text")); // NOI18N
        jmni_creacomentario.setName("jmni_creacomentario"); // NOI18N
        jmni_creacomentario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_creacomentarioActionPerformed(evt);
            }
        });
        jMenu3.add(jmni_creacomentario);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbtn_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_salirActionPerformed
        // TODO add your handling code here:
//        x.cierraConexion();
    this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jbtn_salirActionPerformed

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
    if(JOptionPane.showConfirmDialog(null, "Desea Salir?")==0)
                {
                             this.dispose();
    }

        
}//GEN-LAST:event_jmni_salirActionPerformed

    private void jrbtn_monederoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_monederoActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_monederoActionPerformed

    private void jrbtn_tiendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_tiendaActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_tiendaActionPerformed

    private void jrbtn_emailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_emailActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_emailActionPerformed

    private void jrbtn_nombreclieActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_nombreclieActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_nombreclieActionPerformed

    private void jrbtn_apaternoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_apaternoActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_apaternoActionPerformed

    private void jrbtn_fechaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_fechaActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_fechaActionPerformed

    private void jrbtn_nomovimientosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_nomovimientosActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_nomovimientosActionPerformed

    private void jrbtn_ultcompraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_ultcompraActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_ultcompraActionPerformed

    private void jcbx_tiendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_tiendasActionPerformed
        // TODO add your handling code here:
        int indeceta=this.jcbx_tiendas.getSelectedIndex();
        if (indeceta > 0 )
            {
                indeceta=indeceta-1;
                tiendafiltro=jtable_tiendas.getValueAt(indeceta, 1).toString();
                System.out.println("entro"+tiendafiltro);
                controlcombo=1;
                if(this.jtf_busqueda.toString().length()> 0)
                    {
                        this.jbtn_busquedaActionPerformed(evt);
                    }
                else
                    {
                        this.buttonGroup1.setSelected(jrbtn_100.getModel(), true);
                        buscamp=0;
                        this.jbtn_busquedaActionPerformed(evt);
                    }

                
            }
        else
            {
            
              if (controlcombo > 0 )
                {
                 tiendafiltro="all";
                 if(this.jtf_busqueda.toString().length()> 0)
                    {
                        this.jbtn_busquedaActionPerformed(evt);
                    }
                 else
                    {
                        this.buttonGroup1.setSelected(jrbtn_100.getModel(), true);
                        buscamp=0;
                        this.jbtn_busquedaActionPerformed(evt);
                    }
                 
                 controlcombo=0;
                }
            }

    }//GEN-LAST:event_jcbx_tiendasActionPerformed

    private void jbtn_busquedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_busquedaActionPerformed
        // TODO add your handling code here:
if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0)
        {
            if (buscamp==3)
                {
                    this.carga_datos(buscamp,this.jtf_busqueda.getText());
                }
                else
                {
                    this.carga_datos(buscamp,this.jtf_busqueda.getText().toUpperCase());
                }
        }

    }//GEN-LAST:event_jbtn_busquedaActionPerformed

    private void jtf_busquedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_busquedaActionPerformed
        // TODO add your handling code here:
        this.jbtn_busquedaActionPerformed(evt);
    }//GEN-LAST:event_jtf_busquedaActionPerformed

    private void jrbtn_100ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_100ActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_100ActionPerformed

    private void jmni_creacomentarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_creacomentarioActionPerformed
        // TODO add your handling code here:
        this.crearcomentario();
    }//GEN-LAST:event_jmni_creacomentarioActionPerformed

    private void jbtn_saldogralpuntosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_saldogralpuntosActionPerformed
        // TODO add your handling code here:
       monedero_sie_reporteuso fmsr=new monedero_sie_reporteuso();
       fmsr.pack();
       fmsr.setVisible(true);
    }//GEN-LAST:event_jbtn_saldogralpuntosActionPerformed

    private void jbtn_monederos_entregaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_monederos_entregaActionPerformed
        // TODO add your handling code here:
        this.jbtn_saldogralpuntosActionPerformed(evt);
    }//GEN-LAST:event_jbtn_monederos_entregaActionPerformed

    private void jmni_saldonegativoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_saldonegativoActionPerformed
        // TODO add your handling code here:
      this.carga_datos(6,"");
    }//GEN-LAST:event_jmni_saldonegativoActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed

    private void jmni_actualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_actualizarActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Actualizar?")==0)
            {
                this.carga_datos(0,"");
                this.cargarsaldomon();
            }
    }//GEN-LAST:event_jmni_actualizarActionPerformed


 private void jtb_catalogomonederoMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void crearcomentario()
          {
                 String retorno="";

        String comentario=JOptionPane.showInputDialog("Ingresa Tu Sugerencia o Comentario:");
        if (comentario.length()>0)
        {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_bitacorainserta('"+comentario+"', 'Monedero Catalogo');",variables_global.getconexiongral());
            try
            {

               while (rs.next())
                    {
                         retorno=rs.getString(1);
                   }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
            if (retorno.equals("1"))
              {
                JOptionPane.showMessageDialog(null,"Gracias Tu comentario ha sido guardado", "Sistema Integral Comentarios",1);

              }

      }
    }

    private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_catalogomonedero.getSelectedRow();
         //String valor = jtb_catalogomonedero.getValueAt(fila, 1).toString();
         String idcliente[]=jtb_catalogomonedero.getValueAt(fila, 2).toString().split(":") ;
        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        monedero_sie_catalogo_detalle fmscd=new monedero_sie_catalogo_detalle("",idcliente[0]);
        fmscd.pack();
        fmscd.setVisible(true);
        //setVisible(false);
    }
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new monedero_sie_catalogo().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton jbtn_ayuda;
    private javax.swing.JButton jbtn_busqueda;
    private javax.swing.JButton jbtn_monederos_entrega;
    private javax.swing.JButton jbtn_saldogralpuntos;
    private javax.swing.JButton jbtn_salir;
    private javax.swing.JComboBox jcbx_tiendas;
    private javax.swing.JLabel jlbl_cantidadregistros;
    private javax.swing.JLabel jlbl_textobuscado;
    private javax.swing.JMenuItem jmni_actualizar;
    private javax.swing.JMenuItem jmni_ayuda;
    private javax.swing.JMenuItem jmni_buscar;
    private javax.swing.JMenuItem jmni_busqueda;
    private javax.swing.JMenuItem jmni_creacomentario;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_saldonegativo;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JRadioButton jrbtn_100;
    private javax.swing.JRadioButton jrbtn_apaterno;
    private javax.swing.JRadioButton jrbtn_email;
    private javax.swing.JRadioButton jrbtn_fecha;
    private javax.swing.JRadioButton jrbtn_monedero;
    private javax.swing.JRadioButton jrbtn_nombreclie;
    private javax.swing.JRadioButton jrbtn_nomovimientos;
    private javax.swing.JRadioButton jrbtn_tienda;
    private javax.swing.JRadioButton jrbtn_ultcompra;
    private javax.swing.JTable jtb_catalogomonedero;
    private javax.swing.JTextField jtf_busqueda;
    // End of variables declaration//GEN-END:variables

}
